export const brand = {
  data() {
    var checkPostalCode = (rule, value, callback) => {
      if (!this.form.postalCode||!this.form.postalNo) {
        return callback(new Error(this.$t('formRule.inputPlaceholder')));
      } else {
        callback()
      }
    };
    var checkPhone = (rule, value, callback) => {
      if (!this.form.phoneCode||!this.form.phoneNo) {
        return callback(new Error(this.$t('formRule.inputPlaceholder')));
      } else {
        callback()
      }
    };
    return {
      mode: "add",
      showProp: false,
      disabled: false,
      accountForm: {},
      form: {
        brandId: '',
        accountEmail: '',
        password: '',
        name: '',
        officialAddress: '',
        postalCode: '',
        postalNo: '',
        officialEmail: '',
        phoneCode: '',
        phoneNo: '',
        cinemaQuantity: '',
        cinemaList: [],
      },
      aRules: {
        "oldPassword": [
          {required: true,message: this.$t('formRule.inputPlaceholder'),trigger: 'change'}
        ],
        "newPassword": [
          {required: true,message: this.$t('formRule.inputPlaceholder'),trigger: 'change'}
        ],
      },
      rules: {
        "accountEmail": [
          {required: true,message: this.$t('formRule.inputPlaceholder'),trigger: 'change'}
        ],
        "password": [
          {required: true,message: this.$t('formRule.inputPlaceholder'),trigger: 'change'}
        ],
        "name": [
          {required: true,message: this.$t('formRule.inputPlaceholder'),trigger: 'change'}
        ],
        "officialAddress": [
          {required: true,message: this.$t('formRule.inputPlaceholder'),trigger: 'change'}
        ],
        // "zipCode": [
        //   {required: true,message: this.$t('formRule.inputPlaceholder'),trigger: 'change'}
        // ],
        // "phone": [
        //   {required: true, message: this.$t('formRule.inputPlaceholder'),trigger:'change'}
        // ],
        "postalCode": [
          {required: true, validator: checkPostalCode, trigger:'change'}
        ],
        "phoneCode": [
          {required: true, validator: checkPhone, trigger:'change'}
        ],
      },
      visible: false,
      isSaveing: false
    }
  },
  created(){
    
  }
}
